package com.entity;


import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * ${comments}
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2019-12-05 14:43:15
 */
// todo 频道id 要进行改造 取消 自增长的主键，改为手动输入的频道id, 前端页面不对频道和文章修改处理。全部改到后端
@Entity
@Data
public class Channel implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@ApiModelProperty("主键")
	@GeneratedValue(strategy = GenerationType.AUTO)
	@TableId(value = "id", type = IdType.AUTO)
	private Long id;
	/**
	 * 频道名称
	 */
	@ApiModelProperty("频道名称")
	@Column(columnDefinition = "varchar(30)")
	private String channelName;
	/**
	 * 图标
	 */
	@ApiModelProperty("图标")
	@Column(columnDefinition = "text ")
	private String ico;
	/**
	 * 创建时间
	 */
	@TableField(fill = FieldFill.INSERT)
	@ApiModelProperty("创建时间")
	@JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GMT+8")
	@Column(columnDefinition = "datetime")
	private Date crDate;
	/**
	 * 拥有者Id
	 */
	@ApiModelProperty("创建id")
	@Column(columnDefinition = "varchar(30) ")
	private String userId;
	/**
	 * 拥有者姓名
	 */
	@ApiModelProperty("创建人")
	@Column(columnDefinition = "varchar(30) ")
	private String crName;
	/**
	 * 修改时间 
	 */
	@TableField(update = "getdate()")
	@ApiModelProperty("修改时间")
	@JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GMT+8")
	private Date moDate;
	/**
	 * 是否开放
	 */
	@ApiModelProperty("是否开放")
	@Column(columnDefinition = "varchar(10) ")
	private String isOpen;
	/**
	 * 是否删除
	 */
	@ApiModelProperty("是否删除")
	@Column(columnDefinition = "varchar(10) ")
	private String isAvailable;

	@ApiModelProperty("描述")
	@Column(columnDefinition = "text")
	private String descre;


}
